package com.sjzl.service;

import java.util.List;

import com.sjzl.entity.Board;
import com.sjzl.entity.Post;
import com.sjzl.entity.User;

public interface PostService extends BaseService<Post>{
	/**
	 * 获取帖子列表
	 * @param board_id
	 * @return
	 */
	public List<Post> getPostListByBoardId(Integer board_id);
	
	/**
	 * 获取分页帖子列表
	 * @param board_id
	 * @return
	 */
	public List<Post> getPagePostListByBoardId(Integer board_id, int pageNo, int pageSize) throws Exception;
	
	/**
	 * 创建主题帖子
	 * @param post
	 * @param board
	 * @param user
	 */
	public void create(Post post, Board board, User user);
	
	/**
	 * 查询记录总数
	 * @param entityName
	 * @param where
	 * @param board_id 所属版块的ID号
	 * @return
	 */
	public Integer getTotalCount(String entityName, String where, Integer board_id);
	
	/**
	 * 删除帖子
	 * @param post_id
	 * @return
	 */
	public boolean deletePost(Integer post_id) throws Exception;
	
	/**
	 * 获取最后一条数据
	 * @param Board_id
	 * @return
	 */
	public Post getLast(Integer board_id);
	
	/**
	 * 举报帖子
	 * @param post_id
	 * @return
	 */
	public boolean report(Integer post_id);
}
